/** When your routing table is too long, you can split it into small modules**/

import Layout from '@/layout/index.vue'

const baseInfoRouter = [
  {
    path: '/baseInfo',
    component: Layout,
    redirect: '/baseInfo',
    name: 'baseInfo',
    meta: {
      title: '基础信息管理',
      icon: 'Setting',
      roles: ['ROLE_MANAGER', 'ROLE_BUYER', 'ROLE_WORK'],
    },
    children: [
      {
        path: 'client',
        component: () => import('@/views/baseInfo/client/index.vue'),
        name: 'client',
        meta: {
          title: '客户管理',
          keepAlive: true,
          icon: 'MenuIcon',
          roles: ['ROLE_MANAGER', 'ROLE_BUYER', 'ROLE_WORK'],
        },
      },
      {
        path: 'supplier',
        component: () => import('@/views/baseInfo/supplier/index.vue'),
        name: 'supplier',
        meta: {
          title: '供应商管理',
          keepAlive: true,
          icon: 'MenuIcon',
          roles: ['ROLE_MANAGER', 'ROLE_BUYER', 'ROLE_WORK'],
        },
      },
      {
        path: 'supplier/info',
        component: () => import('@/views/baseInfo/supplier/supplierInfo/index.vue'),
        name: 'supplierInfo',
        hidden: true,
        meta: { title: '供应商详情', icon: 'MenuIcon', roles: ['ROLE_MANAGER'] },
      },
      {
        path: 'user',
        component: () => import('@/views/baseInfo/user/index.vue'),
        name: 'user',
        meta: { title: '员工管理', keepAlive: true, icon: 'MenuIcon', roles: ['ROLE_MANAGER'] },
      },
      {
        path: 'fileType',
        component: () => import('@/views/baseInfo/fileTypeDic/index.vue'),
        name: 'fileType',
        meta: {
          title: '文件类型管理',
          keepAlive: true,
          icon: 'MenuIcon',
          roles: ['ROLE_MANAGER'],
        },
      },
    ],
  },
]

export default baseInfoRouter
